<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title> constructor & prototype & __proto__ </title>
</head>
<body>
    <script>
        function ClassA() {
            this.c = 1;
            this.a = function () {};
            this.b = function () {};
        }
        printChain(ClassA);
        console.log(ClassA.prototype == Object);

        var objA = new ClassA();
        printChain(objA);

        function ClassB() {
            this.prototype = {
                a: function () {},
                b: function () {},
                c: function () {}
            }
        }
        printChain(ClassB);

        function printChain(obj) {
            console.log('==========' + obj.name + '==========');
            console.log('obj\n', obj);
            console.log('obj.constructor\n', obj.constructor);
            // Object.getPrototypeOf(obj) === obj.__proto__ // true
        }

        /***************/
        
        

    </script>
</body>
</html>